import React, { Component } from 'react'

export default class App extends Component {
    myRef = React.createRef()
    render() {
        return (
            <div>
                {/* <input ref="name"/>
                <button onClick={() => {
                    console.log("click", this.refs.name.value);
                }}>add1</button> */}
                <input ref={this.myRef}/>
                <button onClick={() => {
                    console.log("click", this.myRef.current.value);
                }}>add1</button>
            </div>
        )
    }
}
